package com.guigu.aggregation.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.guigu.aggregation.DTO.AppDriverQueryDTO;
import com.guigu.aggregation.DTO.work.DriverJobDTO;
import com.guigu.aggregation.mapper.DriverMapper;
import com.guigu.aggregation.service.DriverService;
import com.guigu.tms.result.R;
import com.guigu.tms.result.ResultCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DriverServiceImpl implements DriverService {

    @Autowired
    private DriverMapper driverMapper;

    @Override
    public R<DriverJobDTO> findByPage(AppDriverQueryDTO dto) {
        IPage<DriverJobDTO> iPage = new Page();
        iPage.setSize(dto.getPageSize());
        iPage.setCurrent(dto.getPage());
        IPage<DriverJobDTO> page = driverMapper.findByPage(iPage, dto);

        return new R(ResultCode.SUCCESS_CODE,"查询成功!",page);
    }
}
